import lejos.robotics.subsumption.Behavior;

public class MoveForward implements Behavior 
{
	private boolean isSurpressed = false;
	private MapMaker mm= null;
	
	public MoveForward(MapMaker mm) 	{		this.mm = mm;	}
	
	@Override
	public void action() 
	{	
		isSurpressed = false;
		mm.snav.forward();
		
		while ( !isSurpressed) 
		{
			try {
			
					Thread.sleep(100);
				} catch (InterruptedException e) {				}
		mm.UpdatePose(); 
		} 									
	
	}
	@Override 
	public void suppress() 	{ 		
		this.isSurpressed = true; 
//		mm.snav.stop();
	}
	
	@Override
	public boolean takeControl() 	{ 		return true; 	}
}
